use clap::Parser;
use io::Config;

mod average;
mod io;
mod server;

/// This is My homework for Distributed System in Rust
/// It will make a simple Gossip Protocol
fn main() {
    let config = Config::parse();
    let res = run_modeler(config);
    println!("Result >>>> {}, {}", res.0, res.1);
}

fn run_modeler(config: Config) -> (f64, usize) {
    let mut modeler = average::AverageManager::new(config);
    modeler.init();
    modeler.exec();
    // modeler.show();
    modeler.result()
}
